package com.ganeshkrishnan.globald.manager.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.ganeshkrishnan.globald.dao.CountryManagerDao;
import com.ganeshkrishnan.globald.manager.CountryManager;
import com.ganeshkrishnan.globald.model.CountryDetail;

public class CountryManagerImpl implements CountryManager {
	protected final Log	log	= LogFactory.getLog(getClass());
	@Autowired
	CountryManagerDao	countryManagerDao;

	public CountryManagerImpl(CountryManagerDao countryManagerDao) {
		this.countryManagerDao = countryManagerDao;
	}

	public void setCountryManagerDao(CountryManagerDao countryManagerDao) {
		this.countryManagerDao = countryManagerDao;
	}

	public List<CountryDetail> getAll() {
		log.debug("in manager impl trying to get all");
		List<CountryDetail> l = countryManagerDao.getAll();
		//		List l = new ArrayList();
		//		CountryDetail cd1 = new CountryDetail();
		//		cd1.setcName("IN");
		//		
		//		CountryDetail cd2 = new CountryDetail();
		//		cd2.setcName("US");
		//		l.add(cd1);
		//		l.add(cd2);
		System.out.println("manager got " + l);
		log.info("manager got " + l);
		return l;
	}
}
